package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value = "ProValueCardGivenStatus", description = "储值卡转赠状态过程")
@Data
@ToString
public class ProValueCardGivenStatus {

	@ApiModelProperty("赠送人的会员卡号")
	String senderCardNo;
	@ApiModelProperty("接收人的会员卡号")
	String receiverCardNo;
	@ApiModelProperty("消息ID")
	String msgId;
	@ApiModelProperty("接收人的手机号")
	String receiverMobile;
	@ApiModelProperty("转赠的储值卡卡号")
	String senderValueCardNo;
	@ApiModelProperty("是否接受，'Y'接受，'N'不接受")
	String givenStatus;

	@ApiModelProperty(value = "过程返回id", hidden = true)
	Integer messageId;
	@ApiModelProperty(value = "过程返回信息", hidden = true)
	String message;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
